Align offline agitation retrieval signals#668
Conversation
…-remediation # Conflicts: # docs/branch-review-ledger.md
Resolved merge conflict in docs/branch-review-ledger.md by keeping all entries from both branches in chronological order.
…n' into codex/release-blocker-remediation
…-remediation # Conflicts: # docs/branch-review-ledger.md
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
…n' into codex/release-blocker-remediation # Conflicts: # src/lib/clinical-search.ts
Static PR checks failed on format:check for a single wrapped assignment. Collapse it so Prettier --check passes and PR required can gate green.
…n' into codex/release-blocker-remediation # Conflicts: # src/lib/clinical-search.ts
…-remediation # Conflicts: # docs/branch-review-ledger.md # src/lib/clinical-search.ts # tests/clinical-search.test.ts
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughChangesMedication evidence retrieval
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Query
participant ClinicalSearch
participant RetrievalSelection
participant RetrievalIntent
Query->>ClinicalSearch: provide agitation medication query
ClinicalSearch->>ClinicalSearch: derive amount, route, and frequency terms
ClinicalSearch-->>Query: return constrained clinical search query
Query->>RetrievalSelection: provide normalized query
RetrievalSelection->>RetrievalSelection: derive medication evidence intent
RetrievalSelection-->>RetrievalIntent: set dose and route signals
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef448e212d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const match of query.matchAll( | ||
| /\b(\d+(?:\.\d+)?)\s*(mg|mcg|micrograms?|milligrams?|ug)\b|\b(\d+(?:\.\d+)?)\s*([µμ]g)/gi, |
There was a problem hiding this comment.
Preserve hyphenated dose units
When users write doses as adjectival forms like 5-mg or 100-mcg (common in clinical copy), this regex does not match because it only allows whitespace between the number and unit. Since buildClinicalTextSearchQuery() replaces the token list with medicationDoseEvidenceSearchTerms(), those agitation queries collapse to agitation arousal dose and drop the explicit amount/unit instead of preserving 5 mg, weakening recall for dose-specific rows; a focused test such as buildClinicalTextSearchQuery("What 5-mg option is listed for agitation?") would catch it.
Useful? React with 👍 / 👎.
Summary
Why
PR #666 was squash-merged while its late review fix was still being reconciled. The merged bot fix duplicates the retrieval alias regex and maps every
mg/mcgrequest tomg; this focused follow-up keeps the stronger tested implementation without changing thresholds or provider behavior.Verification
npx vitest run tests/clinical-search.test.ts tests/retrieval-query-variants.test.ts— 112/112 passed after syncing merged PR Fix offline release retrieval latency #666.git diff --check— passed.Checks pending / intentionally delegated
Clinical governance
Clinical KB Database(sjrfecxgysukkwxsowpy).Summary by CodeRabbit
Bug Fixes
Tests
Documentation